package fileexplorer.util;

/**
 * Created with IntelliJ IDEA.
 * User: rejeev
 * Date: 5/12/13
 * Time: 8:53 PM
 * To change this template use File | Settings | File Templates.
 */
public class OSUtil {
    public static enum OS {Windows, Linux, Mac, Unknown}
    public static OS osType;

    static {
        osType = getOSType();
    }

    public static OS getOSType(){
        String os = System.getProperty("os.name").toLowerCase();
        if(os.indexOf("win") >= 0) return OS.Windows;
        if(os.indexOf("linux") >= 0) return OS.Linux;
        if(os.indexOf("mac") >= 0) return OS.Mac;
        return OS.Unknown;
    }

    public static String getTerminalName(){
        OS osType = getOSType();
        if(osType.equals(OS.Windows)) return "cmd.exe";
        if(osType.equals(OS.Linux)) return "gnome-terminal";
        return null;
    }

    public static String getWorkingDirOptionName(){
        OS osType = getOSType();
        if(osType.equals(OS.Linux)) return "--working-directory=";
        return null;
    }
}
